package com.ota.client.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Date;

/**
 * 检查更新响应数据传输对象
 */
public class CheckResponse {
    
    @JsonProperty("need_update")
    private boolean needUpdate;
    
    @JsonProperty("latest_version")
    private String latestVersion;
    
    @JsonProperty("current_version")
    private String currentVersion;
    
    @JsonProperty("message")
    private String message;
    
    @JsonProperty("firmware_info")
    private FirmwareInfo firmwareInfo;
    
    @JsonProperty("task_info")
    private TaskInfo taskInfo;
    
    // Getters and Setters
    public boolean isNeedUpdate() {
        return needUpdate;
    }
    
    public void setNeedUpdate(boolean needUpdate) {
        this.needUpdate = needUpdate;
    }
    
    public String getLatestVersion() {
        return latestVersion;
    }
    
    public void setLatestVersion(String latestVersion) {
        this.latestVersion = latestVersion;
    }
    
    public String getCurrentVersion() {
        return currentVersion;
    }
    
    public void setCurrentVersion(String currentVersion) {
        this.currentVersion = currentVersion;
    }
    
    public String getMessage() {
        return message;
    }
    
    public void setMessage(String message) {
        this.message = message;
    }
    
    public FirmwareInfo getFirmwareInfo() {
        return firmwareInfo;
    }
    
    public void setFirmwareInfo(FirmwareInfo firmwareInfo) {
        this.firmwareInfo = firmwareInfo;
    }
    
    public TaskInfo getTaskInfo() {
        return taskInfo;
    }
    
    public void setTaskInfo(TaskInfo taskInfo) {
        this.taskInfo = taskInfo;
    }
    
    /**
     * 固件信息
     */
    public static class FirmwareInfo {
        @JsonProperty("version")
        private String version;
        
        @JsonProperty("description")
        private String description;
        
        @JsonProperty("file_size")
        private long fileSize;
        
        @JsonProperty("release_time")
        private Date releaseTime;
        
        @JsonProperty("download_url")
        private String downloadUrl;
        
        // Getters and Setters
        public String getVersion() {
            return version;
        }
        
        public void setVersion(String version) {
            this.version = version;
        }
        
        public String getDescription() {
            return description;
        }
        
        public void setDescription(String description) {
            this.description = description;
        }
        
        public long getFileSize() {
            return fileSize;
        }
        
        public void setFileSize(long fileSize) {
            this.fileSize = fileSize;
        }
        
        public Date getReleaseTime() {
            return releaseTime;
        }
        
        public void setReleaseTime(Date releaseTime) {
            this.releaseTime = releaseTime;
        }
        
        public String getDownloadUrl() {
            return downloadUrl;
        }
        
        public void setDownloadUrl(String downloadUrl) {
            this.downloadUrl = downloadUrl;
        }
    }
    
    /**
     * 任务信息
     */
    public static class TaskInfo {
        @JsonProperty("id")
        private String id;
        
        @JsonProperty("name")
        private String name;
        
        @JsonProperty("execute_time")
        private String executeTime;
        
        @JsonProperty("effective_time")
        private Date effectiveTime;
        
        // Getters and Setters
        public String getId() {
            return id;
        }
        
        public void setId(String id) {
            this.id = id;
        }
        
        public String getName() {
            return name;
        }
        
        public void setName(String name) {
            this.name = name;
        }
        
        public String getExecuteTime() {
            return executeTime;
        }
        
        public void setExecuteTime(String executeTime) {
            this.executeTime = executeTime;
        }
        
        public Date getEffectiveTime() {
            return effectiveTime;
        }
        
        public void setEffectiveTime(Date effectiveTime) {
            this.effectiveTime = effectiveTime;
        }
    }
} 